<template>
 
    <el-dialog title="编辑学生信息" :visible.sync="dialogVisible">  //  此页面为备用页面。效果无效
      <el-form ref="editForm" :model="editedStudent" label-width="80px">
        <el-form-item label="姓名">
          <el-input v-model="editedStudent.name"></el-input>
        </el-form-item>
        <el-form-item label="年龄">
          <el-input v-model.number="editedStudent.age"></el-input>
        </el-form-item>
        <el-form-item label="性别">
          <el-radio-group v-model="editedStudent.gender">
            <el-radio label="male">男</el-radio>
            <el-radio label="female">女</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <div slot="footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="handleSubmit">确定</el-button>
      </div>
    </el-dialog>
  </template>
  <script>
 import axios from 'axios';

  export default {
    name: 'EditStudent',
    props: {
      student: Object,
    },
    data() {
      return {
        dialogVisible: false,
        editedStudent: {
          name: '',
          age: '',
          gender: '',
        },
      };
    },
    methods: {
      handleEdit() {
        this.editedStudent = {
          name: this.student.name,
          age: this.student.age,
          gender: this.student.gender,
        };
        this.dialogVisible = true;
      },
      handleSubmit() {
        this.$emit('edit', this.editedStudent);
        this.dialogVisible = false;
      },
      handleCancel() {
        this.dialogVisible = false;
      },
    },
  };
  </script>